<!DOCTYPE html>
<html>
<head>
    <title>人员管理</title>
	<#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div class="form-group col-sm-5">
                <template>
                    <div class="block" >
                        <el-date-picker
                                v-model="queryByDate"
                                type="daterange"
                                value-format="yyyy-MM-dd"
                                unlink-panels
                                start-placeholder="开始日期"
                                end-placeholder="结束日期">
                        </el-date-picker>
                    </div>
                </template>
            </div>
            <a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("fun:emp:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;单个新增</a>
			</#if>
            <!--导入文件-->
            <#if shiro.hasPermission("fun:emp:import")>
            <a class="btn btn-primary" @click="dialogFormVisible = true"><i class="fa fa-plus"></i>&nbsp;批量新增</a>
            <el-dialog title="导入文件" :visible.sync="dialogFormVisible">
               <!-- <el-upload
                        class="upload-demo"
                        accept="xlsx"
                        action="../../fun/emp/importExcel"
                        :on-preview="handlePreview"
                        :on-remove="handleRemove"
                        :before-remove="beforeRemove"
                        multiple
                        :limit="1"
                        :file-list="fileList">
                    <el-button size="small" type="primary">点击上传</el-button>
                    <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
                </el-upload>-->

                <el-upload
                        class="upload-demo"
                        ref="upload"
                        accept="xlsx"
                        drag
                        action="../../fun/emp/importExcel"
                        multiple
                        :limit="1"
                        :file-list="fileList"
                        :auto-upload="false">
                    <i class="el-icon-upload"></i>
                    <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                    <div class="el-upload__tip" slot="tip">只能上传xlsx文件</div>
                </el-upload>
                <div slot="footer" class="dialog-footer">
                    <el-button @click="dialogFormVisible = false">取 消</el-button>
                    <el-button type="primary" @click="submitUpload">导入</el-button>
                </div>
            </el-dialog>
            </#if>
            <#if shiro.hasPermission("fun:emp:export")>
            <a class="btn btn-info" @click="exportExcel"><i class="fa fa-file-excel-o"></i>&nbsp;导出</a>
            </#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>
    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
					<div class="form-group">
                        <div class="col-sm-2 control-label">员工名</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="emp.empName" placeholder="员工名"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">身份证号</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="emp.idCard" placeholder="必填"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">所属部门</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" style="cursor:pointer;" v-model="emp.deptName" @click="deptTree" readonly="readonly" placeholder="所属部门"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">性别</div>
                        <div class="col-sm-10">
                            <template>
                            <el-radio v-model="emp.gender" label="1">男</el-radio>
                            <el-radio v-model="emp.gender" label="2">女</el-radio>
                            </template>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">出生日期</div>
                        <template>
                        <div class="block col-sm-10">
                                <el-date-picker
                                        v-model="emp.birthDate"
                                        type="date"
                                        value-format="yyyy-MM-dd"
                                        placeholder="选择日期">
                                </el-date-picker>
                        </div>
                        </template>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">籍贯</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="emp.nativePlace" placeholder="籍贯"/>
                        </div>
                    </div>
					<div class="form-group">
                        <div class="col-sm-2 control-label">学历</div>
                        <template>
                        <el-select v-model="emp.education" placeholder="请选择">
                            <el-option
                                    v-for="item in education"
                                    :key="item.value"
                                    :label="item.value"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                        </template>
                    </div>
                <div class="form-group">
                    <div class="col-sm-2 control-label">毕业院校</div>
                    <div class="col-sm-10">
                        <input type="text" class="form-control" v-model="emp.graduateSchool" placeholder="毕业院校"/>
                    </div>
                </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">政治面貌</div>
                <template>
                <el-select v-model="emp.politicalBackground" placeholder="请选择">
                    <el-option
                            v-for="item in politicalBackground"
                            :key="item.value"
                            :label="item.value"
                            :value="item.value">
                    </el-option>
                </el-select>
                </template>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">参加工作时间</div>
                <template>
                <div class="block col-sm-10">
                    <el-date-picker
                            v-model="emp.joinWorkTime"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择日期">
                    </el-date-picker>
                </div>
                </template>

            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">加入部门时间</div>
                <template>
                <div class="block col-sm-10">
                    <el-date-picker
                            v-model="emp.joinDeptTime"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择日期">
                    </el-date-picker>
                </div>
                </template>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">新进类型</div>
                <template>
                    <el-select v-model="emp.joinType" placeholder="请选择">
                        <el-option
                                v-for="item in joinType"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                        </el-option>
                    </el-select>
                </template>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">电话</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="emp.mobile" placeholder="电话"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">地址</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="emp.addr" placeholder="地址"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="emp.remarks" placeholder="备注"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
</div>
<!-- 选择部门 -->
<div id="deptLayer" style="display: none;padding:10px;">
    <ul id="deptTree" class="ztree"></ul>
</div>
<script src="${request.contextPath}/statics/js/modules/function/emp_add.js?_${.now?long}"></script>
</body>
</html>